package com.example.hao.day10_10.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;

import com.example.hao.day10_10.MessageEvent;
import com.example.hao.day10_10.R;
import com.example.hao.day10_10.service.MyService;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

public class Main2Activity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        startService(new Intent(this, MyService.class));

    }

    public void playMusic(View view) {
        EventBus.getDefault().post(new MessageEvent(1));
    }


    @Override
    protected void onStop() {
        super.onStop();
    }
}
